3.700 \(\int \frac{(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx\)

Optimal. Leaf size=99 \[ -\frac{a^3 (-7 B+i A) (1+i \tan (e+f x))^3}{48 c^4 f (1-i \tan (e+f x))^3}-\frac{a^3 (B+i A) (1+i \tan (e+f x))^3}{8 c^4 f (1-i \tan (e+f x))^4} \]

[Out]

-(a^3*(I*A + B)*(1 + I*Tan[e + f*x])^3)/(8*c^4*f*(1 - I*Tan[e + f*x])^4) - (a^3*(I*A - 7*B)*(1 + I*Tan[e + f*x
])^3)/(48*c^4*f*(1 - I*Tan[e + f*x])^3)

________________________________________________________________________________________

Rubi [A]  time = 0.138471, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.073, Rules used = {3588, 78, 37} \[ -\frac{a^3 (-7 B+i A) (1+i \tan (e+f x))^3}{48 c^4 f (1-i \tan (e+f x))^3}-\frac{a^3 (B+i A) (1+i \tan (e+f x))^3}{8 c^4 f (1-i \tan (e+f x))^4} \]

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^4,x]

[Out]

-(a^3*(I*A + B)*(1 + I*Tan[e + f*x])^3)/(8*c^4*f*(1 - I*Tan[e + f*x])^4) - (a^3*(I*A - 7*B)*(1 + I*Tan[e + f*x
])^3)/(48*c^4*f*(1 - I*Tan[e + f*x])^3)

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> -Simp[((b*e - a*f
)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/(f*(p + 1)*(c*f - d*e)), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1)
+ c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, f,
 n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || LtQ
[p, n]))))

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^(n +
1))/((b*c - a*d)*(m + 1)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rubi steps

\begin{align*} \int \frac{(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(a+i a x)^2 (A+B x)}{(c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a^3 (i A+B) (1+i \tan (e+f x))^3}{8 c^4 f (1-i \tan (e+f x))^4}+\frac{(a (A+7 i B)) \operatorname{Subst}\left (\int \frac{(a+i a x)^2}{(c-i c x)^4} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=-\frac{a^3 (i A+B) (1+i \tan (e+f x))^3}{8 c^4 f (1-i \tan (e+f x))^4}-\frac{a^3 (i A-7 B) (1+i \tan (e+f x))^3}{48 c^4 f (1-i \tan (e+f x))^3}\\ \end{align*}

Mathematica [A]  time = 3.24733, size = 81, normalized size = 0.82 \[ \frac{a^3 (\cos (7 e+10 f x)+i \sin (7 e+10 f x)) ((B-7 i A) \cos (e+f x)-(A+7 i B) \sin (e+f x))}{48 c^4 f (\cos (f x)+i \sin (f x))^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^4,x]

[Out]

(a^3*(((-7*I)*A + B)*Cos[e + f*x] - (A + (7*I)*B)*Sin[e + f*x])*(Cos[7*e + 10*f*x] + I*Sin[7*e + 10*f*x]))/(48
*c^4*f*(Cos[f*x] + I*Sin[f*x])^3)

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 90, normalized size = 0.9 \begin{align*}{\frac{{a}^{3}}{f{c}^{4}} \left ( -{\frac{8\,iB-4\,A}{3\, \left ( \tan \left ( fx+e \right ) +i \right ) ^{3}}}-{\frac{4\,iA+4\,B}{4\, \left ( \tan \left ( fx+e \right ) +i \right ) ^{4}}}+{\frac{iB}{\tan \left ( fx+e \right ) +i}}-{\frac{-5\,B-iA}{2\, \left ( \tan \left ( fx+e \right ) +i \right ) ^{2}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x)

[Out]

1/f*a^3/c^4*(-1/3*(8*I*B-4*A)/(tan(f*x+e)+I)^3-1/4*(4*I*A+4*B)/(tan(f*x+e)+I)^4+I*B/(tan(f*x+e)+I)-1/2*(-5*B-I
*A)/(tan(f*x+e)+I)^2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.32667, size = 130, normalized size = 1.31 \begin{align*} \frac{{\left (-3 i \, A - 3 \, B\right )} a^{3} e^{\left (8 i \, f x + 8 i \, e\right )} +{\left (-4 i \, A + 4 \, B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )}}{48 \, c^{4} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="fricas")

[Out]

1/48*((-3*I*A - 3*B)*a^3*e^(8*I*f*x + 8*I*e) + (-4*I*A + 4*B)*a^3*e^(6*I*f*x + 6*I*e))/(c^4*f)

________________________________________________________________________________________

Sympy [A]  time = 2.02219, size = 168, normalized size = 1.7 \begin{align*} \begin{cases} \frac{\left (- 16 i A a^{3} c^{4} f e^{6 i e} + 16 B a^{3} c^{4} f e^{6 i e}\right ) e^{6 i f x} + \left (- 12 i A a^{3} c^{4} f e^{8 i e} - 12 B a^{3} c^{4} f e^{8 i e}\right ) e^{8 i f x}}{192 c^{8} f^{2}} & \text{for}\: 192 c^{8} f^{2} \neq 0 \\\frac{x \left (A a^{3} e^{8 i e} + A a^{3} e^{6 i e} - i B a^{3} e^{8 i e} + i B a^{3} e^{6 i e}\right )}{2 c^{4}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**4,x)

[Out]

Piecewise((((-16*I*A*a**3*c**4*f*exp(6*I*e) + 16*B*a**3*c**4*f*exp(6*I*e))*exp(6*I*f*x) + (-12*I*A*a**3*c**4*f
*exp(8*I*e) - 12*B*a**3*c**4*f*exp(8*I*e))*exp(8*I*f*x))/(192*c**8*f**2), Ne(192*c**8*f**2, 0)), (x*(A*a**3*ex
p(8*I*e) + A*a**3*exp(6*I*e) - I*B*a**3*exp(8*I*e) + I*B*a**3*exp(6*I*e))/(2*c**4), True))

________________________________________________________________________________________

Giac [B]  time = 1.6331, size = 320, normalized size = 3.23 \begin{align*} -\frac{2 \,{\left (3 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{7} + 3 i \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{6} - 3 \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{6} - 17 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 4 i \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 10 i \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 10 \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 17 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 4 i \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 3 i \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 3 \, B a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 3 \, A a^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )}}{3 \, c^{4} f{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + i\right )}^{8}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="giac")

[Out]

-2/3*(3*A*a^3*tan(1/2*f*x + 1/2*e)^7 + 3*I*A*a^3*tan(1/2*f*x + 1/2*e)^6 - 3*B*a^3*tan(1/2*f*x + 1/2*e)^6 - 17*
A*a^3*tan(1/2*f*x + 1/2*e)^5 + 4*I*B*a^3*tan(1/2*f*x + 1/2*e)^5 - 10*I*A*a^3*tan(1/2*f*x + 1/2*e)^4 + 10*B*a^3
*tan(1/2*f*x + 1/2*e)^4 + 17*A*a^3*tan(1/2*f*x + 1/2*e)^3 - 4*I*B*a^3*tan(1/2*f*x + 1/2*e)^3 + 3*I*A*a^3*tan(1
/2*f*x + 1/2*e)^2 - 3*B*a^3*tan(1/2*f*x + 1/2*e)^2 - 3*A*a^3*tan(1/2*f*x + 1/2*e))/(c^4*f*(tan(1/2*f*x + 1/2*e
) + I)^8)